package com.bosssoft.cloud.wechat.core.bean.msg.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.bosssoft.cloud.wechat.core.bean.WxBaseMsg;
import com.bosssoft.cloud.wechat.infrastructure.constant.WxKeywordConsts;
import com.bosssoft.cloud.wechat.infrastructure.annotation.XmlRoot;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 回复文本消息
 *
 * @author wcy create on 2021/5/27 11:53 上午
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@XmlRoot
public class ContentDTO extends WxBaseMsg {
    /**
     * 回复的消息内容（换行：在content中能够换行，微信客户端就支持换行显示）
     */
    @JSONField(name = "Content")
    private String content;

    /**
     * @param toUserName   用户openid
     * @param fromUserName 公众号
     * @param content      内容
     */
    public ContentDTO(String toUserName, String fromUserName, String content) {
        super(toUserName, fromUserName, String.valueOf(System.currentTimeMillis() / 1000), WxKeywordConsts.MsgType.TEXT);
        this.content = content;
    }
}
